import { alova } from '@/service/request';

/** get Menu page */
export function paginateMenu(params?: Api.SearchParams) {
  return alova.Get<Api.PageRow>('/cms/menu/paginate', {
    params
  });
}

/** get Menu page */
export function treeMenu(params?: Api.SearchParams) {
  return alova.Get<Api.Node>('/cms/menu/tree', {
    params
  });
}

/** get all Menu */
export function listMenu() {
  return alova.Get<Api.Row[]>('/cms/menu/list');
}

/** create Menu */
export function createMenu(data?: Api.Model) {
  return alova.Post<boolean>('/cms/menu/create', data);
}

/** update Menu */
export function updateMenu(data?: Api.Model) {
  return alova.Post<boolean>('/cms/menu/update', data);
}

/** delete Menu */
export function deleteMenu(params: Api.DeleteParams) {
  return alova.Post<boolean>('/cms/menu/delete', undefined, { params });
}

/** delete Menu */
export function batchDelMenu(params: Api.BatchDeleteParams) {
  return alova.Post<boolean>('/cms/menu/batchDel', undefined, { params });
}
